package com.qiyu.tech.im.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.qiyu.tech.im.dao.ChatListMapper;
import com.qiyu.tech.im.entity.ChatListRecord;
import com.qiyu.tech.im.service.ChatListService;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author linhao
 * @Date created in 3:17 下午 2021/4/13
 */
public class ChatListServiceImpl implements ChatListService {

    @Resource
    private ChatListMapper chatListMapper;

    /**
     * 查询会员 我的聊天记录列表信息
     *
     * @param memberId
     * @return
     */
    @Override
    public List<ChatListRecord> selectMyChatList(Long memberId) {
        Map<String,Object> map = new HashMap<>(2);
        map.put("memberId",memberId);
        map.put("showStatus",1);
        return chatListMapper.selectByMap(map);
    }

    @Override
    public Boolean updateMyChatLogItem(String chatLogNo,Long memberId,short showStatus) {
        return chatListMapper.updateMemberLogInVisitable(chatLogNo,memberId,showStatus) >0;
    }

}
